package com.april.service.impl;

import com.april.mapper.TbItemCatMapper;
import com.april.pojo.TbItemCat;
import com.april.pojo.TbItemCatExample;
import com.april.service.ItemCategoryService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: 槐序 廿一
 * @Date: 2023-06-19
 * @Time: 20:03
 * @Description:
 */
@Service
@Transactional
public class ItemCategoryServiceImpl implements ItemCategoryService {

    @Resource
    TbItemCatMapper tbItemCatMapper;

    @Override
    public List<TbItemCat> selectItemCategoryByParentId(Long id) {
        TbItemCatExample tbItemCatExample = new TbItemCatExample();
        tbItemCatExample.createCriteria().andParentIdEqualTo(id);
        return tbItemCatMapper.selectByExample(tbItemCatExample);
    }
}
